package com.eurabia.eggchat.handler;


import com.eurabia.eggchat.VO.ResultVO;
import com.eurabia.eggchat.exception.SportException;
import com.eurabia.eggchat.utils.ResultVOUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * Created by zqx
 * 2017-07-30 17:44
 */
@ControllerAdvice
public class EggchatExceptionHandler {


    @ExceptionHandler(value = SportException.class)
    @ResponseBody
    public ResultVO handlerSellerException(SportException e) {
        return ResultVOUtil.error(String.valueOf(e.getCode()), e.getMessage());
    }

}
